<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>贪吃蛇游戏</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="game-container">
        <h1>贪吃蛇游戏</h1>
        <div class="canvas-container">
            <canvas id="gameCanvas" width="400" height="400"></canvas>
            <div id="canvasOverlay" class="canvas-overlay">
                <div class="speed-control">
                    <label for="speedRange">速度调节:</label>
                    <input type="range" id="speedRange" min="50" max="200" value="150">
                    <span id="speedValue">150</span>
                </div>
                <div class="restart-count">
                    <p>重启次数: <span id="restartCount">0</span></p>
                </div>
                <div class="help-text">
                    <p>提示: 游戏开始前任意键开始，开始后空格键暂停/继续，方向键控制移动</p>
                </div>
                <div class="controls">
                    <button id="startBtn">开始游戏</button>
                </div>
            </div>
        </div>
        <div class="score-container">
            <p>得分: <span id="score">0</span></p>
        </div>
        <div class="controls">
            <button id="resetBtn">重新开始</button>
        </div>
    </div>
    <script src="script.js"></script>
</body>
</html>